package com.heima.apis.article;


import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.comment.dtos.CommentArticleDto;
import com.heima.model.comment.dtos.CommentOperationDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.StatisticsPageDto;
import org.apache.pdfbox.pdmodel.graphics.shading.RadialShadingContext;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

/**
 * @author 陈辉
 * @data 2023 14:50
 */
/*@FeignClient(value = "leadnews-article",fallback = ArticleClientFallback.class)*/
@FeignClient("leadnews-article")
public interface IArticleClient {

    @PostMapping("/api/v1/article/save")
     ResponseResult saveArticle(@RequestBody ArticleDto dto) ;

    @PostMapping("/api/v1/article/quest")
    ResponseResult AllArticle(Integer id);

    @PostMapping("/api/v1/article/find_news_comments")
     ResponseResult findNewsComments(@RequestBody CommentArticleDto dto);

    @PostMapping("/api/v1/article/update_comment_status")
     ResponseResult updateArticleStatus(@RequestBody CommentOperationDto dto);

    /**
     * 图文统计
     * @param wmUserId
     * @param beginDate
     * @param endDate
     * @return
     */
    @GetMapping("/api/v1/article/statisticsNum")
    ResponseResult statisticsNum(@RequestParam("wmUserId") Integer wmUserId, @RequestParam("beginDate") Date beginDate, @RequestParam("endDate") Date endDate);

    /**
     * 图文统计-分页统计
     * @param statisticsPageDto
     * @return
     */
    @PostMapping("/api/v1/article/newPage")
    ResponseResult newPage(@RequestBody StatisticsPageDto statisticsPageDto);
}
